package com.atguigu.interview.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

/**
 * @author gcq
 * @Create 2020-11-18
 */
public enum CountEnum {

    ONE(1,"齐国"),TWO(2,"楚国"),THREE(3,"燕国"),FOUR(4,"赵国"),FIVE(5,"魏国"),SIX(6,"韩国");

   private Integer retCode;
   private String retMessage;

    public Integer getRetCode() {
        return retCode;
    }

    public void setRetCode(Integer retCode) {
        this.retCode = retCode;
    }

    public String getRetMessage() {
        return retMessage;
    }

    public void setRetMessage(String retMessage) {
        this.retMessage = retMessage;
    }

    CountEnum(Integer retCode, String retMessage) {
        this.retCode = retCode;
        this.retMessage = retMessage;
    }
    public static CountEnum forEach_CountEnum(int index){
        CountEnum[] array = CountEnum.values();
        for (CountEnum countEnum : array) {
            if (index == countEnum.getRetCode()) {
                return countEnum;
            }
        }
        return null;
    }

}